///////////////////////////////////////////////////////////
//  EditChoiceCommand.cpp
//  Implementation of the Class EditChoiceCommand
//  Created on:      21-Sep-2013 12:45:23 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#include "EditChoiceCommand.h"
#include "CurrentCommand.h"

using namespace UI;
using namespace UI::CMD;

EditChoiceCommand::EditChoiceCommand(CChoicesView* choices, CCreateCheckListView* createCheckList)
{
  this->m_type = ICommand::EDITCHOICE_CMD;
  this->m_createCheckListView = createCheckList;
  this->m_choicesView = choices;
}


EditChoiceCommand::~EditChoiceCommand()
{

}


void EditChoiceCommand::Execute()
{
  
  this->m_choicesView->SetChoices( this->m_createCheckListView->GetPage()->GetChoices(), this->m_createCheckListView->GetCurChoice());
  this->m_choicesView->Refresh();
  // Set current command
  CurrentCommand::GetInstance()->SetCurrentCommand(this->m_type);
}


ICommand::CommandType EditChoiceCommand::GetType()
{
	return this->m_type;
}